<% if admin_authenticated? %>
<h1>Add new program</h1>

<%= form_for @program do |f| %>

	<% if @program.errors.any? %>
	<h2>Errors:</h2>
	<ul>

<% @program.errors.full_messages.each do |message| %>

<li><%= message %></li>
<%end %>

	</ul>
	<%end%>
	</br>
	</br>
	<p>Photo: <br/>
		<%=f.file_field(:photo)%></p> 
		
		
	
	<p> <%= f .label :name %> <br/>

		<%= f.text_area :name %> 

	</p> 	

 	

<p> <%= f .label :description %> <br/>

		<%= f.text_area :description %> 

	</p> 

	<p>
		<%= f.submit "Add new program" %>

	</p>

<% end %>

<script type="text/javascript">
$(document).ready(
function() {
$('#program_description').redactor();
$('#program_name').redactor();

}
);
</script>

<%else %>

<h1>Are working with AI to create new program?!?! </h1>
<%end%>